Jsp

推荐列表 站点导航

当前位置:首页 > 脚本编程 > Jsp >

JSP_基于jsp:included的使用与jsp:param乱码的解决方法,如果jsp:include 中的page页

来源:网络整理  作者:  发布时间:2020-12-19 12:17
基于jsp:included的使用与jsp:param乱码的解决方法,如果jsp:include 中的page页面存在乱码,则需要在使用jsp:include page=...
 <head><title>jsp include测试页</title></head>


</html>

如果jsp:include 中的page页面存在乱码,则需要在使用<jsp:include page=""> 的页面中的<body>后加上
 <jsp:include page="forward-result.jsp">
 </body>
 <body>
<%@ page language="java" contentType="text/html;charset=UTF-8" %>
    request.setCharacterEncoding('UTF-8") ;//或者指定的编码(GBK或其他)
 <head><title>forward的结果页</title></head>
%>
<html>
 <h3>jsp include 指令测试</h3>
 <%
  <jsp:param value="32" />

<%@ page language="java" contentType="text/html;charset=UTF-8" %>
<html>

<%
  年龄:<%=request.getParameter("age")%><br />
 <body>
  姓名:<%=request.getParameter("username") +"--11"%>
 </body>
forward-result.jsp
  request.setCharacterEncoding("UTF-8") ;

复制代码 代码如下:



jsp-include.jsp
</html>
 %>
如下面所示:
 </jsp:include>
  <jsp:param value="张三" />

相关热词: JSP 方法 解决

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供用于网络技术学习参考,学习中请遵循相关法律法规!

本文地址: https://v30.fanwenzhu.com/jiaob/jsp/5597.shtml

上一篇:没有了
最新文章
热门文章
Copyright © www.juheyunku.com      关于 | 合作 | 声明 | 联系 | 更新 | 地图 | Tags

JSP_基于jsp:included的使用与jsp:param乱码的解决方法,如果jsp:include 中的page页

2020-12-19 编辑:

 <head><title>jsp include测试页</title></head>


</html>

如果jsp:include 中的page页面存在乱码,则需要在使用<jsp:include page=""> 的页面中的<body>后加上
 <jsp:include page="forward-result.jsp">
 </body>
 <body>
<%@ page language="java" contentType="text/html;charset=UTF-8" %>
    request.setCharacterEncoding('UTF-8") ;//或者指定的编码(GBK或其他)
 <head><title>forward的结果页</title></head>
%>
<html>
 <h3>jsp include 指令测试</h3>
 <%
  <jsp:param value="32" />

<%@ page language="java" contentType="text/html;charset=UTF-8" %>
<html>

<%
  年龄:<%=request.getParameter("age")%><br />
 <body>
  姓名:<%=request.getParameter("username") +"--11"%>
 </body>
forward-result.jsp
  request.setCharacterEncoding("UTF-8") ;

复制代码 代码如下:



jsp-include.jsp
</html>
 %>
如下面所示:
 </jsp:include>
  <jsp:param value="张三" />

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供学习参考!
本文地址为 https://v30.fanwenzhu.com/jiaob/jsp/5597.shtml

相关文章

风云图片

推荐阅读

返回Jsp频道首页